package com.fh.service.expand;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.fh.dao.DaoSupport;
import com.fh.entity.EmergencySupply;
import com.fh.entity.Event;
import com.fh.entity.Page;
import com.fh.util.PageData;


@Service("emergencySupplyService")
public class EmergencySupplyService {

	@Resource(name = "daoSupport")
	private DaoSupport dao;
	
	/*
	* 新增
	*/
	public int save(EmergencySupply emergencySupply)throws Exception{
		return dao.save("EmergencySupplyMapper.save", emergencySupply);
	}
	
	/*
	* 删除
	*/
	public void delete(PageData pd)throws Exception{
		dao.delete("EventMapper.delete", pd);
	}
	
	/*
	* 修改
	*/
	public void edit(PageData pd)throws Exception{
		dao.update("EventMapper.edit", pd);
	}
	
	/*
	*列表(按创建时间倒序排列)
	*/
	public List<EmergencySupply> list(Page page)throws Exception{
		return (List<EmergencySupply>)dao.findForList("EventMapper.datalistPage", page);
	}
	
	/*
	*列表(全部)
	*/
	public List<EmergencySupply> listAll()throws Exception{
		return (List<EmergencySupply>)dao.findForList("EventMapper.listAll", null);
	}
	
	/*
	* 通过id获取数据
	*/
	public Event findById(PageData pd)throws Exception{
		Object oj = dao.findForObject("EventMapper.findById", pd);
		return (Event)oj;
	}
	
	/*
	* 批量删除
	*/
	public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
		dao.delete("EventMapper.deleteAll", ArrayDATA_IDS);
	}
	
}

